package com.cn.http;

import com.cn.enums.HttpMethodEnum;

import java.io.IOException;
import java.net.HttpURLConnection;

/**
 * &#064;Time 2024 八月 星期四 22:08
 *
 * @author ShangGuan
 */
public interface HttpRequest {

    /**
     * 启用文件上传
     *
     */
    void enableFileUpload();

    HttpRequest setRequestParams(HttpParam httpParam);


    HttpRequest setRequestMethod(HttpMethodEnum method);


    void setConfig(HttpConfig config);

    void setConnection(HttpURLConnection connection);

    /**
     * 执行，方法会关闭所使用的流，所以请不要手动关闭流
     *
     * @return {@link HttpResponse }
     * @throws IOException IOException
     */
    HttpResponse execute() throws IOException;

    HttpResponse post() throws IOException;

    HttpResponse get() throws IOException;

    HttpResponse put() throws IOException;

    HttpResponse delete() throws IOException;
}
